/*
  Copyright (C) 2011, Kyungjoo Kim
  
  This file is part of LINAL (LINear ALgebra)
  
  All rights reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
  
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
  
  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  Also add information on how to contact you by electronic and paper mail.
  
  
  Kyungjoo Kim
  iamkyungjoo@gmail.com
*/
#ifndef LINAL_UTIL_OPTION_HXX
#define LINAL_UTIL_OPTION_HXX

#define LINAL_OPTION_MODE_DRY 1
#define LINAL_OPTION_MODE_RUN 0

#define LINAL_OPTION_TEXT_QUADRANT "TL(11), TR(12), BL(21), BR(22)"
#define LINAL_OPTION_TEXT_DATATYPE "FLOAT(100), DOUBLE(101), SCOMPLEX(102), DCOUPLEX(103), INT(104), CONST(105)"
#define LINAL_OPTION_TEXT_ELEMTYPE "MATRIX(150), SCALAR(151)"
#define LINAL_OPTION_TEXT_SIDE     "TOP(200), BOTTOM(201), LEFT(210), RIGHT(211)"
#define LINAL_OPTION_TEXT_UPLO     "LOWER(300), UPPER(301)"
#define LINAL_OPTION_TEXT_TRANS    "NO TRANS(400), TRANS(401), CONJ TRANS(402), CONJ NO TRANS(403)"
#define LINAL_OPTION_TEXT_INVERSE  "NO INVERSE(1300), INVERSE(1301)"
#define LINAL_OPTION_TEXT_CONJ     "NO CONJ(450), CONJ(451)"
#define LINAL_OPTION_TEXT_DIAG     "UNIT(500), NON-UNIT(501), ZERO(502)"
#define LINAL_OPTION_TEXT_DIRECT   "FORWARD(800), BACKWARD(801)"
#define LINAL_OPTION_TEXT_STORE    "COLUMN(900), ROW(901)"

namespace linal {

  /*! Command line options
   */
  extern void initialize(Int_ argc, Char_ **argv);
  extern void finalize();

  extern void verbose_begin();
  extern void verbose_end();

  extern bool get_verbose();
  extern int  get_num_threads();

  extern void get_option_bool(const Char_ *opt, const Char_ *text, const Char_ *man, 
                              bool def, bool &val, Int_ mode=LINAL_OPTION_MODE_RUN);
  extern void get_option_int (const Char_ *opt, const Char_ *text, const Char_ *man, 
                              Int_ def, Int_ &val, Int_ mode=LINAL_OPTION_MODE_RUN);
  extern void get_option_double(const Char_ *opt,const Char_ *text,const Char_ *man,
                                Double_ def, Double_ &val, Int_ mode=LINAL_OPTION_MODE_RUN);
}

#endif
